home *** CD-ROM | disk | FTP | other *** search
- /**********************************************************************
- *
- * CustomGetFile Dialog Demo
- *
- * ErrUtils.c
- *
- * This unit handles all my errors in a nice easy fashion.
- * The code comes from "Macintosh Programing Secrets, 3rd Ed"
- * by Scott Knaster and Keith Rollin.
- *
- * Written in CodeWarrior Gold 5.5
- * August 31, 1995
- *
- * Copyright © 1995 Carl B. Constantine
- * Some portions Copyright © 1995 MetroWerks, Inc.
- * Some portions Copyright © 1995 Apple Computer, Inc.
- *
- **********************************************************************/
-
- /*------------------------------------------------------------------
- #
- # File History
- #
- # Date Description of Change
- # ---- ---------------------
- # Aug 31/93 — Original creation of file
- #
- #
- -------------------------------------------------------------------*/
-
-
- /*=========================== Include Files ==============================*/
-
- #include "AppGlobals.h"
- #include "AppConstants.h"
- #include "ErrUtils.h"
-
- /*======================== Procedures and functions ==========================*/
-
-
- /* Display an alert that tells the user an error occurred, then exit the
- program. This routine is used as an ultimate bail-out for serious errors
- that prohibit the continuation of the application. The error number is
- used to index an 'STR#' resource so that a relevant message can be
- displayed. */
-
- void DeathAlert( short errNumber )
- {
- short itemHit;
- Str255 theMessage;
-
- SetCursor( &qd.arrow );
- GetIndString( theMessage, rErrorStrings, errNumber );
- ParamText( theMessage, nil, nil, nil );
- itemHit = Alert( rErrorAlert, nil );
- ExitToShell();
-
- }
-
- /*----------------------------------------------------------------------------*/
-
- /* Display an alert that tells the user an error occurred. This routine is
- used as warning for general errors that prohibit the continuation of the
- application. The error number is used to index an 'STR#' resource so that
- a relevant message can be displayed. */
-
- void GenAlert( short errNumber )
- {
- short itemHit;
- Str255 theMessage;
-
- SetCursor( &qd.arrow );
- GetIndString( theMessage, rErrorStrings, errNumber );
- ParamText( theMessage, nil, nil, nil );
- itemHit = Alert( rErrorAlert, nil );
-
- }
-
- /*============================ End of File ===================================*/